package cn.growthgate.fgo.service.impl;

import cn.growthgate.fgo.entity.LoginLog;
import cn.growthgate.fgo.entity.vo.LoginLogVo;
import cn.growthgate.fgo.mapper.LoginLogMapper;
import cn.growthgate.fgo.service.ILoginLogService;
import cn.growthgate.fgo.common.base.BaseServiceImpl;
import cn.growthgate.fgo.common.base.BaseVo;

import org.springframework.stereotype.Service;

/**
 * <p>
 * 登录日志 服务实现类
 * </p>
 *
 * @author GrowthGate
 * @since 2019-05-09
 */
@Service
public class LoginLogServiceImpl extends BaseServiceImpl<LoginLogMapper, LoginLog> implements ILoginLogService {

	@Override
	public BaseVo<LoginLog> transformVo(LoginLog loginLog) {
		LoginLogVo vo = new LoginLogVo();
		vo.setId(loginLog.getId());
		vo.setUser(baseMapper.getUser(loginLog));
		vo.setLoginTime(loginLog.getLoginTime());
		vo.setHost(loginLog.getHost());
		vo.setOs(loginLog.getOs());
		vo.setUa(loginLog.getUa());
		vo.setUaVersion(loginLog.getUaVersion());
		return vo;
	}
	
}
